<template>
  <div
    style="white-space: pre-line;display: inline-block;background-color: rgba(0,0,0,0.1);width: 100%;">
    <div v-if="dataObj">
      <span v-if="typeof dataObj=='string'">
        {{dataObj}}
      </span>
      <span v-if="typeof dataObj!='string'">
        <span v-if="Array.isArray(dataObj)">
                    <span v-for="(sub,ii) in dataObj">
                      <page-obj-show :from="from+'_'+ii"
                                     :data-obj="sub"
                      ></page-obj-show>
                    </span>
        </span>
        <span v-if="!Array.isArray(dataObj)">
          <span v-for="(item,ind) in dataObj" :key="from+'_'+ind" style="display: inline-block;">
            <span>{{ind}}的值为:</span>
            <page-obj-show :from="from+'_'+ind"
                           :data-obj="item"
            ></page-obj-show>
          </span>
        </span>
      </span>
    </div>
    <div v-if="!dataObj">无</div>
  </div>
</template>

<script>
  export default {
    name: "page-obj-show",
    props: {
      from: {
        type: String,
        default() {
          return '';
        }
      },
      dataObj: {
        type: Array | String | Object,
        default() {
          return '';
        }
      },
    },
  }
</script>

<style scoped>

</style>
